<?php
/**
 * 例子程序
 * @package server
 * @author 任冬 <rendong@corp.the9.com>
 * 
 * $Id: example.php 9 2011-02-23 06:56:47Z sbnnest@gmail.com $
 */

// 包含通用文件
require_once("./lib/base.inc.php");

// 使用数据库
$db_r = orm();
$db_r->query();
$result = $db_r->addTable("Application")->addField("*")->getArray(null, 0, 5);

echo "db test\n";
echo "get db count:" . count($result) . "\n";

// 使用缓存
$mc = cache("memcached", $cfg['memcache']);

echo "cache test\n";
$key = "_test_key_";
$mc->set($key, "testvalue");
echo "get from cache:" . $mc->get($key) . "\n";
$mc->delete($key);

// 使用feed
import("lib.Feed");
$obj_feed = new Feed();
//$obj_feed->queue(1003321, "测试昵称", "测试Feed", FEED_TYPE_APP_INSTALL);

// 使用日志
$obj_log = getLog("test/log");
$obj_log->setData("2009-10-10 12:12:12\t日志数据\t");
$obj_log->write();